package com.homedo.async.mysql.support.convertor.forcolumnname;

/**
 * @author jgshun
 * @date 2020/1/20 1:32 PM
 */
public class DateConditionColumnNameConvertor implements ConditionColumnNameConvertorI {

    private static final DateConditionColumnNameConvertor INSTANCE = new DateConditionColumnNameConvertor();

    private DateConditionColumnNameConvertor() {
    }

    @Override
    public String convertor(String columnName, Class columnClz) {
//        if (java.time.LocalDate.class.isAssignableFrom(columnClz)) {
//            return new StringBuilder().append("DATE(").append(columnName).append(")").toString();
//        } else if (java.time.LocalDateTime.class.isAssignableFrom(columnClz)) {
//            return new StringBuilder().append("TIMESTAMP(").append(columnName).append(")").toString();
//        } else if (java.time.Duration.class.isAssignableFrom(columnClz)) {
//            return new StringBuilder().append("TIME(").append(columnName).append(")").toString();
//        } else if (java.util.Date.class.isAssignableFrom(columnClz)) {
//            return new StringBuilder().append("TIMESTAMP(").append(columnName).append(")").toString();
//        }

        return columnName;
    }

    public static DateConditionColumnNameConvertor getInstance() {
        return INSTANCE;
    }
}
